RakNet
Copyright 2002-2003 Rakkarsoft LLC

Please refer to RakNetSharewareHelp.hlp for the license agreement and documention pertaining to the files herein.

A master game server is a server that maintains a list of running game servers.  It provides the same functionality as Gamespy minus the limited sorting features they provide but for thousands of $$$ less.  It's almost required these days because otherwise your players have no way to find other active games to connect to.

This is the sample implementation of a master game server using RakNet.  There are many features you may wish to add on your own as this is just a shell.

The code is class-based, one class for the master server and another for the master client, which your game should use to talk to the master server.  To include this functionality, just make one instantiation of MasterServer or MasterClient as appropriate.

MasterServer will generally be a console application or a simple windowed application.  To run it, just call Start once, then Update once per frame.  You don't really need anything in main or Winmain except perhaps a way to quit.  It's a good idea to host this on a domain name rather than a specific IP so you can change servers without forcing your players to update.  For example, if your game's website is mutantkillerfrogs.com you can code the MasterClient to connect to this domain, which will be resolved to an IP.

MasterClient is a client that game servers should include and manage.  See the header file for appropriate functionality.  It would be a good idea to connect to a domain name rather than a specific IP (see above).

Sample implementations are given in MasterServerImplementation.cpp and MasterClientImplementation.cpp.

*** IMPORTANT ***
Both files require a small degree of customization in the header files, and MasterServerPacketEnumerations.h is included for for master server specific enums only.  You should customize the files for your own game, and extract the master server specific enums into your own copy of PacketEnumerations.h